package com.kingyea.esb.commons.datawrap;

import java.util.HashMap;
import java.util.Map;

//已完成
public class MessageData extends CommonDataWrap {
	private static final long serialVersionUID = 1L;
	private Object data;


	public MessageData(boolean success, String message) {
		this.success = success;
		this.message = message;
	}
	
	public MessageData(boolean success, String message, Integer code) {
		this.success = success;
		this.message = message;
		this.code = code;
	}

	public MessageData(boolean success, String message, Object data) {
		this.success = success;
		this.message = message;
		this.data = data;
	}
	public Object getData() {
		return this.data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	public Map<String, Object> toMap() {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("success", Boolean.valueOf(this.success));
		result.put("message", this.message);
		return result;
	}
}
